package operators;

import arbore.Operator;

public class Stea  extends Operator{

	public String concatTermeni(String a, String b)
	{
		String aux;
		if((a.compareTo("1") == 0 && b.compareTo("1")==0) || (a.compareTo("1.0") == 0 && b.compareTo("1.0")==0))
			aux="0";
		else 
			if(a.compareTo("1")==0)
				aux=b+"-1";
			else
				if(b.compareTo("1")==0)
					aux=a+"-1";
				else 
					aux=a + "*" + b+ "-1";
		if(a.compareTo("0") == 0 || b.compareTo("0")==0)
			aux="-1";
		return aux;
	}
	public static String concatTermens(String a, String b)
	{
		String aux;
		if((a.compareTo("1") == 0 && b.compareTo("1")==0) || (a.compareTo("1.0") == 0 && b.compareTo("1.0")==0))
			aux="0";
		else 
			if(a.compareTo("1")==0)
				aux=b+"-1";
			else
				if(b.compareTo("1")==0)
					aux=a+"-1";
				else 
					aux=a + "*" + b+ "-1";
		if(a.compareTo("0") == 0 || b.compareTo("0")==0)
			aux="-1";
		return aux;
	}
	
}
